import BaseScene from "../base/Script/core/BaseScene";
import BundleManager from "../base/Script/core/BundleManager";


const {ccclass, property} = cc._decorator;

@ccclass
export default class map extends BaseScene {

    @property(cc.Prefab)
    point:cc.Prefab=null;
    blocks:number[][]=[];
    x=-375;
    y=150;

    start () {
        // 创建地图
        for(let i=1;i<17;i++){
            for(let j=1;j<8;j++){
                console.log('创建')
                let p=cc.instantiate(this.point);
                p.setParent(this.node);
                p.setPosition(this.x+(i-1)*50,this.y-(j-1)*50)
                p.getComponent('click').initposition(i,j)
            }
        }

    }

    // 移除列表中对应的障碍点
    remove_block(block:number[]){
        for(let i in this.blocks){
            if(block+''==this.blocks[i]+''){
                delete this.blocks[i];
                return
            }

        }

    }

    onDestroy() {
        super.onDestroy();
        BundleManager.ins().releaseAll('Astar');
    }

}
